package Time_13;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2024-04-11
 * Time:9:10
 * Text：飞机悬空
 */
import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改
class plane{
    int t;  //抵达时间
    int d;  //可盘旋
    int l;  //降落时间

}
public class Test3 {
    static plane[] array;
    static boolean[] is;
    static int size;
    public static boolean  dfs(int u,int time) {
        if(u >= size) {
            return true;
        }
        for(int i=0; i < size;i++) {
            //判断当前飞机是否已降落
            if(!is[i]) {
                is[i] = true;
                //判断盘旋时间是否小于前一架的降落时间,大于则没问题
                if(array[i].t + array[i].d >= time) {
                    if(dfs(u+1, Math.max(time,array[i].t)+array[i].l))
                        return true;
                }else {
                    //回溯
                    is[i] = false;
                    return false;
                }
                is[i] = false;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        for(int i = 0;i < n; i++){
            int m = scan.nextInt();
            array = new plane[m];
            is = new boolean[m];
            size = m;
            for(int k = 0;k < m;k++){
                array[k] = new plane();
                array[k].t=scan.nextInt();
                array[k].d=scan.nextInt();
                array[k].l=scan.nextInt();
            }
            if(dfs(0,0)) {
                System.out.println("YES");
            }else {
                System.out.println("NO");
            }
        }
        scan.close();
    }
}